<a class="media-left" href="/user/show/${vote.createrId}">
    <img src="${vote.creater.avatarUrl}" class="avatar-md img-circle">
</a>
<div class="media-body" style="width:100%">
    <h4 class="media-heading">${vote.title,xss}</h4>

    <p class="small text-muted">
        ${vote.creater.html}创建于${vote.createTime,prettyTime}
        ,${vote.totalUsers}人参与
        <!--@if(admin||vote.createrId==(session.user.id!)){-->
        ,<a href="javascript:del('${vote.id}');">删除</a>
        <!--@}-->
    </p>
    <!--@if(isEmpty(session.user)){-->
    <p class="text-warning">请于登录后进行投票并查看结果</p>
    <!--@}else if(@vote.hasVoted(session.user.id)){-->
    <!--@for(option in vote.options){
        var percentage = vote.totalVotes==0?0:trunc(option.totalVotes*100/vote.totalVotes,2);
    -->
    <p>${optionLP.index}. ${option.content,xss}</p>

    <div class="progress">
        <div class="progress-bar  progress-bar-${optionLP.index}" role="progressbar"
             aria-valuenow="${percentage}" aria-valuemin="0" aria-valuemax="100" style="width: ${percentage}%;">
            ${percentage}%
        </div>
    </div>
    <!--@}-->
    <!--@}else{-->
    <form class="vote-form" action="/vote/vote/${vote.id}" data-id="${vote.id}" method="post">
        <!--@for(option in vote.options){-->
        <!--@if(vote.type=="MULTIPLE"){-->
        <div class="checkbox">
            <label>
                <input type="checkbox" name="optionId" required value="${option.id}">
                ${option.content,xss}
            </label>
        </div>
        <!--@}else{-->
        <div class="radio">
            <label>
                <input type="radio" name="optionId" required value="${option.id}">
                ${option.content,xss}
            </label>
        </div>
        <!--@}-->
        <!--@}-->
        <p>
            <button class="btn btn-primary btn-sm w100" type="submit">
                <span class="glyphicon glyphicon-saved"></span>&nbsp;投票
            </button>
        </p>
    </form>
    <!--@}-->
</div>
